-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add zoom & pan to charts #23183
Add zoom & pan to charts #23183
Conversation
🎉 |
Indeed. I added double click to reset zoom for now but we need something more obvious for desktop. On mobile you can use your fingers |
We can add buttons later if we want but this is already very usable so we can merge it |
Very nice! One thing i noticed: If you try to zoom out on a chart using binary or text sensors bar chart: the chart gets hidden and does not come back. Behavior is on desktop and my mobile. |
ctrl+select also causes the same issue on Also |
Now I remember that's why I used |
Looks like Google maps use the command button on Mac. Will change to that. They've made it work with |
Maybe it would in a later step also be possible to sync time periods across multiple charts: If for example timeline charts and graph charts is loaded at the same time: Looks like the API could make this possible? chart.pan(delta, scales?, mode = 'none'): void (https://www.chartjs.org/chartjs-plugin-zoom/latest/guide/developers.html#imperative-zoom-pan-api) |
Zooming out for more data is tricky because then you can't easily return to the initial state. We'd have to pollute the UI with a reset button. Panning to the left to load older data would be easier though |
The text sensor chart will be fixed separately #23270 |
Proposed change
Updates to the graph reset the chart so I had to stop updates while zoomed in. Shouldn't be an issue as the user is focusing on the data that is already there.
On mobile zoom & pan is done with touch.
On desktop
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: